package cn.marinda.listener;

import cn.marinda.gui.AbstractServerDialog;
import cn.marinda.gui.impl.ApplicationHelperImpl;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 关闭当前对话框事件
 *
 * @author admin
 * @date 2022/08/01
 */
public class CloseCurrentDialogEvent implements ActionListener {

    private AbstractServerDialog dialog;

    /**
     * 关闭当前对话框事件
     *
     * @param dialog 对话框
     */
    public CloseCurrentDialogEvent(AbstractServerDialog dialog){
        this.dialog = dialog;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        dialog.close();
    }
}
